/**
    Copyright 2015 Table Rider
    By: Richard Solti
*/

#ifndef CORDSYSTEM_H
#define CORDSYSTEM_H
#include <list>
#include "SerialCom.h"
class CordSystem
{
public:
    CordSystem(double, double, SerialCom *);
    CordSystem(double, double);
    //CordSystem(double, double,ControllerMotor*, Motor* ,Motor*);
    //virtual ~CordSystem();
    double getPosX();
    void setPosX(double);
    double getPosY();
    void setPosY(double);
    double getDirection();
    void setDirection(double);
    char getNextStepType();
    void goToJohnPos(double xValue, double yValue);
    double * getNextStepValue();
    int getStepAmount();
    void sendToController(long,long);
    void doNextStep();
    void moveStraight(double);
    void turnBy(double);
    void turnTo(double);
    void moveBy(double, double);
    void moveTo(double, double);
    void update();
protected:
    void updateSerialEnc();
    std::list<double> posXlist, posYlist, turnList;
    std::list<char> stepType;
    double angle, posX, posY;
    long sEncL, sEncR, diffL, diffR, gEncL, gEncR, currEncL, currEncR;
    SerialCom *sercom;
};

#endif // CORDSYSTEM_H
